package svc

import (
	"bytes"
	"context"
	"net/http"

	"github.com/zeromicro/go-zero/core/logx"
)

/**
* @推送服务
* @author  dc.To
* @version 20240118
 */
func (s *ServiceContext) RequestService(ctx context.Context, url string, payload []byte) (*http.Response, error) {
	logx.Debugf("Job Push Url %s,  Payload: %s", url, payload)
	res, err := http.Post(url, "application/json", bytes.NewBuffer(payload))
	if err != nil {
		logx.Error(err)
	}

	if err != nil {
		logx.Error(err)
		return nil, err
	}
	return res, nil
}
